mod generate_function;
mod init_import;
use crate::traits::FilterLibImportTrait;
use common::model::LibImport;
pub use generate_function::generate_function;
pub use init_import::init_import;

impl FilterLibImportTrait for Vec<LibImport> {
    fn filter(&self, command_name: &str) -> Self {
        self.iter()
            .filter(|lib_import| {
                lib_import
                    .command
                    .as_ref()
                    .map(|command| command.contains(&command_name.to_string()))
                    .unwrap_or_default()
            })
            .cloned()
            .collect()
    }
}
